package com.hmdp.config;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: sfx
 * Date: 2023-02-19
 * Time: 20:58
 */

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 配置Redisson
 */
@Configuration
public class RedissonConfig {

    /**
     * 配置RedissonClient
     * @return
     */
    @Bean
    public RedissonClient redissonClient() {
        //配置Redisson
        Config config = new Config();
        config.useSingleServer().setAddress("redis://192.168.238.128:6379").setPassword("123321");
        return Redisson.create(config);
    }
}
